<template>
    <div class="page notTab">
        <Header> 团员 </Header>
        <div class="info" v-if="loaded">
            <div class="list" v-if="list && list.length > 0">
                <div class="group">
                    <div
                        class="item fx aifs"
                        v-for="(i, index) in list"
                        :key="index"
                    >
                        <!-- <div class="face fx jcc">
                            {{ i.nickname.substring(0, 1) }}
                        </div> -->
                        <div class="fx1 xinfo">
                            <div class="t fx aife">
                                <div class="name">{{ i.nickname }}</div>
                                <!-- <div class="level">
                                    级别：{{ level[i.type] }}
                                </div> -->
                            </div>
                            <!-- <div class="m">加入时间：{{ i.addtime }}</div> -->
                            <div class="xl">
                                订单金额：
                                {{ i.total_cost }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div v-else>
                <Nimg src="001x.png" width="750" height="609"></Nimg>
            </div>
        </div>
    </div>
</template>

<script>
import $ from "@/common";
export default {
    data() {
        return {
            list: [],
            level: ["普通会员"],
            loaded: false,
        };
    },
    methods: {
        getList() {
            let url = $.user("team");
            let data = {
                page: 0,
                num: 100000,
            };
            $.post(url, data).then((res) => {
                if (res.isError) {
                    return;
                }
                this.list = $.change(res);
                this.loaded = true;
            });
        },
    },
    onLoad() {
        this.getList();
    },
};
</script>

<style lang="less" scoped>
.list {
    .tip {
        background: #f4f4f4;
        padding: 20rpx;
        .txt {
            margin-left: 10rpx;
            color: #666;
        }
    }
    .group {
        .item {
            padding: 30rpx 20rpx;
            border-bottom: 1px solid #e5e5e5;
            &:last-child {
                border: 0;
            }
            .face {
                border-radius: 50%;
                overflow: hidden;
                width: 100rpx;
                height: 100rpx;
                background: #f0f0f0;
                font-size: 28rpx;
                border: 2rpx solid #ccc;
            }
            .xinfo {
                margin-left: 20rpx;
                padding-right: 20rpx;
                border-right: 1px solid #f2f2f2;
                .name {
                    font-size: 32rpx;
                }
                .level {
                    margin-left: 10rpx;
                }
                .t {
                    padding-bottom: 10rpx;
                }
            }
        }
    }
}
</style>
